$(document).ready(function() {
    $(".vote").click(function() {
        var that = $(this),
                id = that.attr("id"),
                name = that.attr("name"),
                data = {
                    id: id
                };

        if (name == "up") {
            $.ajax({
                type: "POST",
                url: BASE_URL + "/vote/voteUp/" + id,
//                data: data,
                cache: false,
                success: function(up) {
                    that.next().html(up);
                }
            });
        } else {
            $.ajax({
                type: "POST",
                url: BASE_URL + "/vote/voteDown/" + id,
//                data: data,
                cache: false,
                success: function(down) {
                    that.next().html(down);
                }
            });
        }
        return false;
    });
});